<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <script language="JavaScript" type="text/JavaScript">
		function gotoPage(pagenum){
		 // document.getElementById("size2").value = $("#size").val();
		  document.getElementsByName("page")[0].value=pagenum;
		  document.forms[0].submit();
		  return ;
		}
		function refind(){
			gotoPage(1);
		}
/* $(".page_square").click(function(){
	$(this).addClass("page-box_current");
	
}) */
	</script>

	
<style>
.page-box{ width:700px; margin:0 auto; overflow:hidden;}
.page-box li{ float:left; margin-left:3px; margin-right:3px; border:solid 1px #e0e0e0; padding:6px 10px;}
.page-box li:hover{ border:solid 1px orange;}
.page-box_current{ border:solid 1px orange;}	
</style>	


<%-- <c:if test="${page.totalPage > 1}" > --%>
	<ul class="page-box">
		<a  class="page_square" href="javascript:gotoPage(1);"><li><span><首页></span></li></a>
		<c:choose>
        	<c:when test="${(page.page == null?1:page.page) <= 1}">
 	 	    	<a  class="page_square" href="javascript:;"><li><span>上一页</span></li></a>
        	</c:when>
        	<c:otherwise>
        		<a  class="page_square" href="javascript:gotoPage(${page.page - 1});"><li><span>上一页</span></li></a>
        	</c:otherwise>
        </c:choose>
        
        <!-- 当前页以前页码-->
        <c:if test="${(page.page - 5)>0}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page -5 });"><li><span>${page.page - 5}</span></li></a>
        </c:if>
        <c:if test="${(page.page - 4)>0}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page -4 });"><li><span>${page.page - 4}</span></li></a>
        </c:if>
 		<c:if test="${(page.page - 3)>0}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page -3 });"><li><span>${page.page - 3}</span></li></a>
        </c:if>
 		<c:if test="${(page.page - 2)>0}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page -2 });"><li><span>${page.page - 2}</span></li></a>
        </c:if>
        <c:if test="${(page.page - 1)>0}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page -1 });"><li><span>${page.page - 1}</span></li></a>
        </c:if>
        
        <!-- 当前页 -->
        <a class="page_square1" href="javascript:gotoPage(${page.page});"><li style="border:solid 1px orange;">${page.page}</li></a>
        
        <!-- 当前页以后页码-->
        <c:if test="${(page.page + 1) <= page.totalPage}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page + 1 });"><li><span>${page.page + 1}</span></li></a>
        </c:if>
        <c:if test="${(page.page + 2) <= page.totalPage}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page + 2 });"><li><span>${page.page + 2}</span></li></a>
        </c:if>
        <c:if test="${(page.page + 3) <= page.totalPage}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page + 3 });"><li><span>${page.page + 3}</span></li></a>
        </c:if>
        <c:if test="${(page.page + 4) <= page.totalPage}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page + 4 });"><li><span>${page.page + 4}</span></li></a>
        </c:if>
        <c:if test="${(page.page + 5) <= page.totalPage}">
        	<a class="page_square1" href="javascript:gotoPage(${page.page + 5 });"><li><span>${page.page + 5}</span></li></a>
        </c:if>
        <c:choose>
        	<c:when test="${page.page == page.totalPage}">
 	 	    	<a class="page_square1" href="javascript:;"><li><span>下一页></span></li></a>
        	</c:when>
        	<c:otherwise>
        		<a class="page_square1" href="javascript:gotoPage(${page.page + 1});"><li><span>下一页></span></li></a>
        	</c:otherwise>
        </c:choose>
        	<a class="page_square1" href="javascript:gotoPage(${page.totalPage});"><span><li><末页></span></li></a>
	</ul>
<%-- </c:if> --%>